package com.server.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import com.server.service.ICommonDataService;
import com.server.service.IReferralService;
import com.server.web.DataVector;
import com.server.web.RequestInput;

@Service("ReferralService")
public class ReferralService implements IReferralService {
	
	private static final String VIEW_NAME = "reward.v_user_employ";
	
	@Autowired
	private JdbcTemplate jdbcTemplate;
	@Autowired
	private ICommonDataService commonDataService;
	

	 /**
	 * 我招聘的人员列表
	 * @param requestInput
	 * @return
	 * @author ServerZhang
	 * @date 2017年3月10日
	 * 修改：已返费完成的不显示在列表中
	 * @author ServerZhang
	 * @date 2017年3月29日
	 */
	@Override 
	public DataVector<Map<String, Object>> getList(RequestInput requestInput, 
			Integer state,String cardId){
		String whereStr = String.format("State=%s and Source='%s' and LimitCount>0", state,cardId) ;
		String sortStr = "EmployTime desc";
		return commonDataService.getListData(VIEW_NAME, whereStr, sortStr,
				requestInput);
	}
	
}
